home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / patches / patchemu / patchemu.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1996-02-16  |  1.2 KB  |  63 lines

  1. /* Patch emu object V1.2 */
  2. /* © by Stefan Haubenthal 1995/96 */
  3. /* A 030/25 takes 187 seconds */
  4. /* Chamäleon II:
  5.  
  6.                  AUTOREN
  7.      Thomas Wieger & Thorsten Deuter
  8.  
  9. © MAXON Computer GmbH 1991
  10.   Industriestraße 26
  11.   65760 Eschborn
  12.   Germany
  13.   Telephone: +49 6196 481811
  14.   FAX:       +49 6196 41885
  15.   E-Mail:    info@maxon.pfm-mainz.de
  16.  
  17. (Don't move VBR) */
  18. call EMU
  19. say
  20. call close file
  21. call open(file,"MI")
  22. call patch(pos("00be"x,readch(file,65535))-1,"00bc"x)
  23. exit
  24.  
  25. EMU:
  26. name="EMU.OBJ"
  27. len=28504 /* 35000 */
  28. key="BW"
  29. call open in,name
  30. call open out,"t:"name,W
  31. call code(1)
  32. file=out
  33. call patch(x2d(580),"888"x)
  34. call close out
  35. call close in
  36.  
  37. key="BW"
  38. call open in,"t:"name
  39. call open out,name,W
  40. /*call code(0)*/
  41. queue "delete >nil: t:"name
  42.  
  43. CODE:
  44. if arg(1)=1 then exp="key=reverse(bitxor(word,reverse(key)))" /* decode */
  45.             else exp="key=reverse(bitxor(word,bitxor(key,reverse(key))))"
  46. do len%2
  47.     word=readch(in,2)
  48.     call writech out,bitxor(word,key)
  49.     interpret exp
  50. end
  51. return
  52.  
  53. PATCH:
  54. parse arg position,data
  55. if position<0 then exit 10
  56. call seek(file,position,'B')
  57. say c2x(readch(file,length(data)))
  58. call seek(file,-length(data))
  59. call writech(file,data)
  60. call seek(file,-length(data))
  61. say c2x(readch(file,length(data)))
  62. return
  63.